{% extends "base.html" %}

{% load i18n %}
{% load pytils_dt %}
{% load pytils_numeral %}
{% load discussion_tags %}
{% load theme %}

{% block title %}{{ object.name }}{% endblock %}

{% block extrahead %}
{% theme_css "highlight" %}
{% theme_js "highlight" %}
<script type="text/javascript">initHighlightingOnLoad('html', 'css', 'python');</script>
{% theme_js "comments" %}
{% theme_js "jquery.form" %}
{% theme_js "ajaxforms" %}
<link rel="alternate" type="application/rss+xml" title="{{ settings.BLOG_NAME }}: comments on {{ object.name }} feed" href="{% url atom_feed feedurl %}" />
<link rel="pingback" href="http://{{ site.domain }}{% url pingback %}" />
{% endblock %}

{% block content %}
{% include "blog/post_entry.html" %}

<a class="comment-link" onclick="return comment();" href="#">{% trans "Comment" %}</a>

{% block pingbacks %}
{% if object.pingbacks.all|length %}
<div id="pingbacks"><h2>{% trans "Pingbacks" %}</h2>
  {% for pingback in object.pingbacks.all %}
  {% include "blog/pingback.html" %}
  {% endfor %}
</div>
{% endif %}
{% endblock %}

{% comment_tree_for_object object as comments %}
{% block comments %}
<div id="comments"><h2>{% trans "Comments" %}</h2>
  {% if not comments %}
    <div>{% trans "No comments for this post" %}</div>
  {% endif %}

  {% for comment in comments %}
  {% include "blog/comment.html" %}
  {% endfor %}
  
  {% if object.comments_open %}{% if not reply_to %}
  {% include "blog/comment_form.html" %}
  {% endif %}{% endif %}
                                   
</div>
{% endblock %}
{% endblock %}

